home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-25 | 2.6 KB | 81 lines | [TEXT/CWIE] |
- // ==================================================
- // CDateEditField.h
- // Copyright (C) 1996-1997 Mizutori Tetsuya
- // July 4 ,1996; February 3, 1997.
- // ==================================================
- // All documents are pretty-printed in 10-point Geneva font.
-
- #pragma once
-
- #include <LEditField.h>
-
- #include <LBroadcaster.h>
- #include <LListener.h>
-
-
- class CDateEditField : public LEditField, public LListener, public LBroadcaster {
-
- public:
- enum { class_ID = 'DedF' };
-
- static CDateEditField * CreateDateEditFieldStream( LStream *inStream );
- CDateEditField();
- CDateEditField( const CDateEditField &inOriginal);
- CDateEditField(
- const SPaneInfo &inPaneInfo,
- Str255 inString,
- ResIDT inTextTraitsID,
- Int16 inMaxChars,
- Boolean inHasBox,
- Boolean inHasWordWrap,
- KeyFilterFunc inKeyFilter,
- LCommander *inSuper);
- CDateEditField(
- const SPaneInfo &inPaneInfo,
- Str255 inString,
- ResIDT inTextTraitsID,
- Int16 inMaxChars,
- Uint8 inAttributes,
- KeyFilterFunc inKeyFilter,
- LCommander *inSuper);
- CDateEditField( LStream *inStream);
- virtual ~CDateEditField();
-
- // Do nothing here
- virtual void ListenToMessage( MessageT inMessage, void * ioParam );
- // Set 'mHasChanged' to true if text has been changed
- virtual void UserChangedText( void );
- // Do dragging text
- virtual void ClickSelf( const SMouseDownEvent & inMouseDown );
- // Do nothing here
- virtual void BeTarget( void );
- // Call RefreshEditField() once when this EditField becomes no target
- virtual void DontBeTarget( void );
-
- // Handle dragging text in this edit field.
- Boolean DoDragText( const EventRecord &inMacEvent, const Point inMousePosition );
-
- // Test / Set the activity status of TextEdit
- Boolean GetTEActive( void );
- void SetTEActive( const Boolean inStatus );
- // Get / Set the selection of TextEdit
- void GetSelect( long & outSelStart, long & outSelEnd );
- void SetSelect( const long inSelStart, const long inSelEnd );
- // Read / Write the text string from this EditField
- void GetText( Str255 outString );
- void SetText( const Str255 inString );
- // Write text string, and then refresh it
- void SetTextAndRefresh( const Str255 inString);
- // Convert date time seconds to string, and write it
- void SetDateTime( const unsigned long inDateTimeSeconds );
- // Refresh the EditField if this text has been changed
- void RefreshEditField( void );
-
- private:
-
- Boolean mHasChanged; // true if text has been changed by user's action
- };
-
- // end of definitions
-
-